package com.market.quote.interfaces.rest.vo;

import com.market.quote.common.CommonStatus;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

/**
 * @author duweibin
 * @date 2024/4/22
 * @description result vo
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ResultVO<T> {
    private Integer statusCode;
    private String statusMsg;
    private T data;

    public static <T> ResultVO<T> of(int status_code, String status_msg, T data) {
        return new ResultVO<>(status_code, status_msg, data);
    }

    public static <T> ResultVO<T> of(CommonStatus commonStatus, T data) {
        return new ResultVO<>(commonStatus.getCode(), commonStatus.getMessage(), data);
    }


}
